'use strict';

angular.module('SystemManage').controller('RoleListController', ['$scope', 'PublicModule', 'PublicEnum', '$location', 'Authentication',
    function($scope, PublicModule, PublicEnum, $location, Authentication) {
    	PublicModule.initModule($scope, 'Role');
        $scope.Module.Role.LoadMode = PublicEnum.LoadMode.CacheAndPaging;
        $scope.Module.Role.PageSize = 15;
        $scope.Module.Role.load();

        $scope.btnAdd = function(){
        	$location.url('/index/Role/Edit');
        };

        $scope.rowDblClick = function(){
            $scope.$apply(function(){
                $location.url("/index/Role/Edit/" + $scope.Module.Role.FocusedRecord._id);
            });
        };

        $scope.btnDelete = function(){
        	$scope.Module.Role.deleteSelecteds(function(){
        		$scope.Module.Role.load();
        	});
        };
    }
]);
